from selenium.webdriver.common.by import By

from autoTest_ecshop.base_page.base import BasePage

class HomePage(BasePage):
    # 搜索框定位器
    keyword_loc = (By.ID,'keyword')
    # 搜索按钮定位器
    sBtn_loc = (By.XPATH, '//*[@type="submit"]')

    # 商品橱窗定位
    shop_window_loc = (By.XPATH,'//*[@id="compareForm"]/div/div/div/a[1]')

    # 加入购物车定位
    shop_cart_loc = (By.XPATH,'//*[@id="ECS_FORMBUY"]/ul/li[7]/a[1]')

    # 查看购物车
    view_cart_loc = (By.XPATH, '//*[@id="topNav"]/a[1]')

    # 删除商品定位器(断言)
    delgoods_loc = (By.XPATH, '//*[@id="formCart"]/table[1]/tbody/tr[2]/td[7]/a[1]')

    # 结算中心定位
    buy_center_loc = (By.XPATH,'/html/body/div[7]/div[1]/table/tbody/tr/td[2]/a/img')

    # 提交订单定位
    submit_loc = (By.XPATH,'//*[@id="theForm"]/div[15]/div[2]/input[1]')

    # 返回首页断言定位
    return_home_loc = (By.XPATH,'/html/body/div[7]/div/p/a[1]')